Page({
  data: {
    imgUrls: [
      '../../static/images/swipper/tooopen_1.jpg',
      '../../static/images/swipper/tooopen_3.jpg',
      '../../static/images/swipper/tooopen_2.jpg'
    ],
    channel: [
      { 
        iconUrl: '../../static/images/icon/jingqump.png',
        name: '景区门票',
        directUrl:'/pages/scenic/scenic'
      },
      {
        iconUrl: '../../static/images/icon/luyouxl.png',
        name: '旅游线路',
        directUrl: '/pages/sunny/sunny'
      },
      {
        iconUrl: '../../static/images/icon/jiudianfj.png',
        name: '酒店房间',
        directUrl: '/pages/hotel/hotel'
      },
      {                                                       
        iconUrl: '../../static/images/icon/topic_selected.png',
        name: '活动大厅',
        directUrl: '/pages/activity/activity'
      } 
    ],
    msgList: [
      {
        title: '重大通知'
      },
      {
        title: '很大的通知'
      }
    ],
    fotter: [
      {
        iconUrl: '../../static/images/icon/zhuye.png',
        name: '主页'
      },
      {
        iconUrl: '../../static/images/icon/huodong.png',
        name: '活动'
      },
      {
        iconUrl: '../../static/images/icon/wd.png',
        name: '我的'
      }
    ],
    scrolltext:[
      {
        iconUrl: '../../static/images/swipper/tooopen_1.jpg',
        name: '鄂尔多斯草原给第三方第三方第三方第三方第三方法范德萨范德萨范德萨',
        cont:'的哈时间多看哈圣诞节和圣诞节哈市的金卡的范德萨范德萨范德萨热温热污染费范德萨范德萨范德萨范德萨范德萨'
      },
      {
        iconUrl: '../../static/images/swipper/tooopen_2.jpg',
        name: '鄂尔多斯草原',
        cont: '的哈时间多看哈圣诞节和圣诞节哈市的金'
      },
      {
        iconUrl: '../../static/images/swipper/tooopen_3.jpg',
        name: '鄂尔多斯草原',
        cont: '的哈时间多看哈圣诞节和圣诞节哈市的金'
      }
    ],
    pictext: [
      '../../static/images/icon/zuanshi.png',
      '../../static/images/icon/huangguan.png',
      '../../static/images/icon/youhui.png'
    ],
    hot: [
      {
        title: '腾格里沙漠通湖草原旅游区',
        price: '39',
        decimal: '00',
        imageUrl: '../../static/images/swipper/tooopen_1.jpg',
        directUrl: ''
      },
      {
        title: '腾格里沙漠通湖草原旅游区',
        price: '39',
        decimal: '00',
        imageUrl: '../../static/images/swipper/tooopen_1.jpg',
        directUrl: ''
      }
    ],
    indicatorDots: true,
    autoplay: true, 
    interval: 3000,
    duration: 1000,
    // 页面配置  
    winWidth: 0,
    winHeight: 0,
    // tab切换 
    currentTab: 0,
    tabclass: ''
  },
  onLoad: function () {
    var that = this;
    // 获取系统信息 
    wx.getSystemInfo({
      success: function (res) {
        that.setData({
          winWidth: res.windowWidth,
          winHeight: res.windowHeight
        });
      }
    });
  },
  // 滑动切换tab 
  bindChange: function (e) {
    var that = this;
    that.setData({ currentTab: e.detail.current });
  },
  // 点击tab切换 
  swichNav: function (e) {
    var that = this;
    if (this.data.currentTab === e.target.dataset.current) {
      return false;
    } else {
      that.setData({
        currentTab: e.target.dataset.current
      })
    } 
  }, /*
  upper: function (e) {   bindscrolltoupper="upper"
    console.log(1)
    this.setData({
      tabclass: ""
    })
  },*/
  upper: function (e) {
    console.log(e.detail.scrollTop)
    if (e.detail.scrollTop==17) {
      this.setData({
        tabclass: "position:fixed; top:50px; "
      })
    }
    
  }
})